package com.changwu.cwbase.ui.commont;

import android.os.Bundle;

import com.changwu.cwbase.Constants;
import com.changwu.cwbase.R;
import com.changwu.cwbase.base.ActivityBase;
import com.changwu.cwbase.widget.AppJzvd;

import butterknife.BindView;
import cn.jzvd.Jzvd;

/*
 * 通用使用模板
 */
public class CommonVideoPlayerActivity extends ActivityBase {
    @BindView(R.id.videoPlayer)
    AppJzvd videoPlayer;
    private String mPath = "";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_video_player);
        initView();
    }

    @Override
    public void initToolBar() {
        super.initToolBar();
        title.setText("视频");
    }

    private void initView() {
        mPath = getIntent().getStringExtra(Constants.CONTENT);
        videoPlayer.setUp(mPath
                , "", Jzvd.SCREEN_WINDOW_NORMAL);
    }

    @Override
    public void onBackPressed() {
        if (Jzvd.backPress()) {
            return;
        }
        super.onBackPressed();
    }

    @Override
    protected void onPause() {
        super.onPause();
        Jzvd.releaseAllVideos();
    }

   /* @OnClick({R.id.back})
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.back:
                finish();
                break;
        }
    }*/
}
